<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <base href="<?php echo base_url(); ?>"/>
    <title><?php echo $title; ?></title>
    <link href="style/base.css" rel="stylesheet" type="text/css"/>
    <link href="style/common.css" rel="stylesheet" type="text/css"/>
    <link href="style/houtai.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="uploadify/uploadify.css">
    <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>

    <script src="uploadify/jquery.uploadify.min.js" type="text/javascript"></script>

    <script src="js/organictabs.jquery.js"></script>
    <script type="text/javascript" src="js/Common.js"></script>
    <script type="text/javascript" src="js/Validation.js"></script>
    <script type="text/javascript" src="jscript/WdatePicker.js"></script>
    <script type="text/javascript" src="js/jquery.form.js"></script>
    <script type="text/javascript" src="js/jquery.blockUI.js"></script>
    <!--[if IE 6]>
    <script type="text/javascript" language="javascript" src="js/ie6/DD_belatedPNG_0.0.8a-min.js"></script>
    <script type="text/javascript" language="javascript">
        DD_belatedPNG.fix('.logo img,.footer_logo img');
    </script>
    <![endif]-->
    <script type="text/javascript">
        var idcardtype = 1;
        $(function () {
            $("#imgIdCard1").bind("click", function () {
                idcardtype = 1;
                $("#fileIdCard").click();
            });
            $("#imgIdCard2").bind("click", function () {
                idcardtype = 2;
                $("#fileIdCard").click();
            });
            $("#fileIdCard").bind("change", function () {
                if (idcardtype == 1)
                    $("#txtFile1").val($("#fileIdCard").val());
                else
                    $("#txtFile2").val($("#fileIdCard").val());
                var fileName = $("#fileIdCard").val();
                var ext = fileName.substr(fileName.indexOf(".")).toLowerCase();
                if (ext != ".gif" && ext != ".jpg" && ext != ".jpeg" && ext != ".png" && ext != "") {
                    alert("图片格式无效");
                    return;
                }
                if (!IsEmpty(fileName)) {
                    $("#formCard").submit();
                    return;
                }
            });
            $("#imgSubmitCard").bind("click", function () {
                var idno = $("#txtIdCardNo").val();
                if (IsEmpty(idno)) {
                    SetError("txtIdCardNo", "身份证号不能为空");
                    return;
                }
                if (!IsIdCard(idno)) {
                    SetError("txtIdCardNo", "身份证号无效");
                    return;
                }
                ClearError("txtIdCardNo");
                var params = {idcardno: idno};
                $.ajax({
                    type: "post",
                    url: "index.php/manage/saveIdCardNo",
                    dataType: "json",
                    data: params,
                    success: function (data) {
                        alert("保存成功");
                    }
                });
            });
            bindSubmitIdCard();
        });

        function bindSubmitIdCard() {
            var options = {
                beforeSubmit: showRequestIdCard,  //提交前处理
                success: showResponseIdCard,  //处理完成
                resetForm: false,
                dataType: 'json'
            };

            $('#formCard').submit(function () {

                $(this).ajaxSubmit(options);
                return false;
            });
        }
        function showRequestIdCard(formData, jqForm, options) {
            return true;
        }

        function showResponseIdCard(data, statusText) {
            if (data.ReturnCode == 1) {
                savePicIdCard(data.src);
            } else {

            }
            return false;
        }

        function savePicIdCard(url) {
            var params = {
                idcardurl: url
            };
            var url = "index.php/manage/saveIdCard";
            if (idcardtype != 1)
                url = "index.php/manage/saveIdCard2";
            $.ajax({
                type: "post",
                url: url,
                dataType: "json",
                data: params,
                async: false,
                success: function (data) {

                }
            });
        }
    </script>
<body>
<?php
include 'header.php';
?>
<div class="houtai_content mt_10 clearfix">
    <!-- 侧栏 开始 -->
    <?php
    include 'member_left.php';
    ?>
    <div class="houtai_main">
        <div class="houtai_zhanghugl">
            <div class="houtai_main_tit">用户中心—认证管理</div>
            <div class="houtai_zhanghugl_cntB">
                <form id="formCard" action="index.php/login/uploadImg" method="post" enctype="multipart/form-data">
                <!-- 账户设置 开始 -->
                <div class="zhanghu_k">
                    为保证信息的真实有效，杜绝并防止违法行为的发生，将对用户进行身份认证； <br/> 身份认证为非强制性措施，可根据个人意愿进行申请； <br/>
                    身份认证信息完全保密，仅作为职场麻豆官方认证使用，不像第三方进行泄露； <br/> <span class="b">开通身份认证，排名优先、名称变色、人气提升更快、曝光率更高！</span>

                </div>
                    <div class="zhanghu_k">
                        姓&nbsp;&nbsp;&nbsp;&nbsp;名：<input name="" type="text" value="<?php echo $user['realname']; ?>" readonly="readonly" disabled="disabled" style="width: 276px; height: 25px;">
                    </div>
                    <div class="zhanghu_k">
                        身份证号：<input id="txtIdCardNo" value="<?php echo $user['idcardno']; ?>" type="text" style="width: 276px; height: 25px;">
                    </div>
                    <div class="zhanghu_k">
                        <div>
                            <!-- <img id="idcard" src="<?php if(empty($user['idcardurl'])) print "images/vip_img.jpg"; else print $user['idcardurl'];?>" /> -->
                            <img id="idcard" src="images/vip_img.jpg"/>
                        </div>
                        <div>
                            <p class="font_s18">示例效果</p>
                            <br/> <span>1、免冠照片、请与身份证保持一致 <br/> 2、身份证件的文字清晰可见 <br/>
					3、不得遮盖头像及证件
				</span>

                        </div>
                    </div>

                    <!--
                            <div id="container" style="text-align: center; padding: 50px;">
                                <div id="fileQueue"></div>
                                <div class="btn-group">
                                    <input type="file" name="uploadify" id="uploadify" /> <a
                                        href="javascript:jQuery('#uploadify').uploadifyUpload()"
                                        class="btn">上传</a> <a
                                        href="javascript:jQuery('#uploadify').uploadifyClearQueue()"
                                        class="btn">取消</a>
                                </div>
                            </div>
                    -->
                    <div class="zhanghu_k">
                        <input type="text" id="txtFile1" style="width: 276px; height: 25px;" disabled="disabled"/><img id="imgIdCard1" src="images/sczp_inp.jpg" class="link" style="width:100px;height:30px;vertical-align:middle;"/>
                    </div>
                    <div class="zhanghu_k">
                        <input type="text" id="txtFile2" style="width: 276px; height: 25px;" disabled="disabled"/><img id="imgIdCard2" src="images/sczp_inp.jpg" class="link" style="width:100px;height:30px;vertical-align:middle;"/>
                    </div>
                    <div class="filter_inp"><img id="imgSubmitCard" class="link" src="images/ljrz_inp.jpg"></div>
                    <!-- 账户设置 结束 -->
                    <input type="file" id="fileIdCard" name="mypic" style="display:none"/>

                </form>
            </div>
        </div>
    </div>
    <!-- 用户中心活动经历 E -->
</div>
<!-- 页脚 开始 -->
<?php include 'footer.php'; ?>
<!-- 页脚 结束 -->
</body>
</html>
